package com.hspedu.exception_;

public class ClassCastException {
    public static void main(String[] args) {
        A b = new B();//向上转型
        B b2 = (B)b;//向下转型
        C b3 = (C)b;//抛出异常ClassCastException
    }
}


class A {}

class B extends A {}

class C extends A {}